/* Anhui Wanyun Information Technology Co., Ltd. */
package com.liliudong.pinkyponk.biz.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.liliudong.pinkyponk.biz.base.BaseEntity;
import com.liliudong.pinkyponk.biz.sys.enums.SysRoleDataScope;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 系统角色
 *
 * @author Liudong.li
 * @version 1.0
 * @date 2021-10-14 21:17
 */
@Data
@TableName
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysRole extends BaseEntity implements Serializable {

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 数据权限
     */
    private SysRoleDataScope dataScope;
    /**
     * 角色编码
     */
    private String roleCode;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SysRole sysRole = (SysRole) o;
        return Objects.equals(id, sysRole.id) && Objects.equals(roleCode, sysRole.roleCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, roleCode);
    }


}
